﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using System.Data.SqlClient;

namespace QuanLyKhoHang
{
    public partial class frmThemNhanVien : Form
    {
        connect conn;
        public frmThemNhanVien()
        {
            conn = new connect();
            InitializeComponent();
        }

        private void btnDong_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void btnThem_Click(object sender, EventArgs e)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.Connection = conn.getconnect();
            cmd.CommandText = "insert into nhanvien values ('" + txtMaNhanVien.Text + "','" + txtTenNhanVien.Text + "','" + txtTenDangNhap.Text + "','" + txtMatKhau.Text + "','" + txtDiaChi.Text + "','" + dtpNgaySinh.Text + "','" + txtGioiTinh.Text + "'," + txtQuyen.Text + ")";

            cmd.ExecuteNonQuery();
            this.Dispose();
            frmQuanLyNhanVien frm = new frmQuanLyNhanVien();
            frm.Show();
        }
    }
}
